<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>音乐播放器</title>
</head>
<body>
    <audio id="audioPlayer" controls autoplay>
        <source id="audioSource" type="audio/mpeg">
        您的浏览器不支持音频元素。
    </audio>

    <script>
        function playSong(url) {
            document.getElementById('audioSource').src = url;
            document.getElementById('audioPlayer').load();
            document.getElementById('audioPlayer').play();
        }

        // 监听从主页面发来的消息
        window.addEventListener('message', function(event) {
            playSong(event.data);
        }, false);
    </script>
</body>
</html>
